package com.example.keli.ui.my.adapter;

import android.content.Context;
import android.graphics.Typeface;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.keli.R;
import com.example.keli.base.adapter.RecyclerAdapter;
import com.example.keli.base.adapter.RecyclerViewHolder;
import com.example.keli.base.utils.DataUtil;
import com.example.keli.base.utils.DensityUtil;
import com.example.keli.base.utils.ScreenUtil;
import com.example.keli.ui.my.model.CommissionVO;
import com.example.keli.ui.my.model.InviteUserVO;
import com.example.keli.ui.userinfo.UserInfoDialog;

import java.util.List;

/**
 * description $desc$
 * created by jerry on 2019/3/18.
 */
public class CommissionAdapter extends BaseQuickAdapter<CommissionVO, BaseViewHolder> {

    public CommissionAdapter(List<CommissionVO> mData, Context context) {
        super(R.layout.item_info_common, mData);
    }

    @Override
    protected void convert(BaseViewHolder hepler, final CommissionVO commissionVO) {
        ImageView imageView = hepler.getView(R.id.iv_avatar);
        TextView time = hepler.getView(R.id.tv_name);
        TextView name = hepler.getView(R.id.tv_subtitle);
        TextView status = hepler.getView(R.id.tv_right_title);
        TextView money = hepler.getView(R.id.tv_right_subtitle);

        Glide.with(mContext).load(commissionVO.getAvatar()).into(imageView);
        time.setTextColor(mContext.getResources().getColor(R.color.text_hint));
        time.setText(DataUtil.getData(commissionVO.getAdd_time()));
        status.setVisibility(View.VISIBLE);
        status.setTextColor(mContext.getResources().getColor(R.color.text_color));
        status.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
        status.setText("审核通过");
        name.setVisibility(View.VISIBLE);
        name.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
        name.setTextColor(mContext.getResources().getColor(R.color.text_color));
        name.setText(commissionVO.getNickname());
        money.setVisibility(View.VISIBLE);
        money.setTextColor(mContext.getResources().getColor(R.color.text_color));
        money.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
        money.setText(String.format("+￥ %s", commissionVO.getTotal()));

    }
}
